﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Title_Publish.aspx.cs" Inherits="WeChat.Title_Publish" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>自定义新闻</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="default" />
    <meta http-equiv="cache-control" content="no-transform" />
    <meta content="telephone=no" name="format-detection"/>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <link href="css/Dish.css" rel="stylesheet" type="text/css"/>
    <%--    <script src="js/jquery.min.js"></script>--%>
    <script src="js/jquery-1.11.0.min.js"></script>
    <script src="layer/layer.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            
            //$(this).delegate("label", "click", function () {
            //    if ($(this).children('input').is(":checked")) {
            //        $(this).css('background-color', '#576ffe');
            //        $(this).css('color', '#fff');
            //        $(this).nextAll().css('background-color', '#f8fbf9');
            //        $(this).prevAll().css('background-color', '#f8fbf9');
            //        $(this).nextAll().css('color', '#576ffe');
            //        $(this).prevAll().css('color', '#576ffe');
            //    }
            //})

            getMyCookie();
        })
        function getMyCookie() {

            var url = decodeURI(window.location.href);
            var aa = url.indexOf('=');
            if (aa > -1) {
                url = url.substring(aa + 1);

            }

            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                data: { jh: url, funcname: "Custom_Information" },
                dataType: "json",
                success: function (data) {
                    var json = JSON.parse(data.rows);
                    $("#menu").empty();
                    $("#menu").append(InitList(json));
                    for (var i = 0; i < json.length; i++) {
                        // $("#textarea01").val(json[i].CustomContent);
                       // $("#textarea01").append(json[i].CustomContent);
                      //  $("#textarea01").append("<img class='img[]' src='" + json[i].images + "' />");
                      //  $("#div03").append("<img class='img[]' src='images/dougan.jpg' />");
                       // $("#div03").append("<img  style='height: 150px;width: 120px;' src='images/dougan.jpg' images/dougan.jpg/>");
                    }

                }
            })
        }

        function myrefresh() {
            window.location.reload();
        }
        var str = '';
        var num = '';
        //提交问卷调查，获取机号，id值，选项！
        function Findings() {
            $('label').children("input[type='radio']:checked").each(function () {
                //str += $(this).val() + ",";
                str += $(this).attr("value") + ",";
                num += $(this).attr("data") + ",";
            });
            //请求方法
            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                data: {
                    questionCode: str,
                    content: num,
                    questionjh: jh,
                    funcname: "FindingsAdd"
                },
                dataType: "json",
                success: function (data) {
                    if (data <= 0) {
                        layer.msg("问卷调查添加失败！", { icon: 2 });
                        return false;
                    } else {
                        layer.msg("问卷调查添加成功！", { icon: 1 });
                        //指定1秒刷新一次 
                        setTimeout('myrefresh()', 2000);
                    }
                }

            })
        }


        //生成菜单列表
        var jh = "";
        function InitList(json) {
            debugger;
            var s = "";
            var Num = 0;
            var name = "";
            var for01 = "";
            var for02 = "";
            var for03 = "";
            var for04 = "";
            var for05 = "";
            var id01 = "";
            var id02 = "";
            var id03 = "";
            var id04 = "";
            var id05 = "";

            for (var i = 0; i < json.length; i++) {
                Num++;

                name = "opption" + Num.toString();
                for01 = "excellent" + Num.toString();
                for02 = "Very nice" + Num.toString();
                for03 = "good" + Num.toString();
                for04 = "soso" + Num.toString();
                for05 = "bad" + Num.toString();
                id01 = "excellent" + Num.toString();
                id02 = "Very nice" + Num.toString();
                id03 = "good" + Num.toString();
                id04 = "soso" + Num.toString();
                id05 = "bad" + Num.toString();
                jh = json[i].questionjh;

                //  s += "<li><span>" + Num + ". " + json[i].questionName + "：</span><div class='big'><label for='" + for01 + "' id='c1'> <input name='" + name + "' type='radio' id='" + id01 + "' value='" + json[i].questionCode + "'/>" + json[i].optionA + "</label> <label for='" + for02 + "' id='c1'>  <input name='" + name + "' type='radio' id='" + id02 + "' value='" + json[i].questionCode + "'/>" + json[i].optionB + "</label> <label for='" + for03 + "' id='c1'> <input name='" + name + "' type='radio' id='" + id03 + "' value='" + json[i].questionCode + "'/>" + json[i].optionC + "</label><label for='" + for04 + "' id='c1'><input name='" + name + "' type='radio' id='" + id04 + "' value='" + json[i].questionCode + "'/>" + json[i].optionD + "</label> <label for='" + for05 + "' id='c1'><input name='" + name + "' type='radio' id='" + id05 + "' value='" + json[i].questionCode + "'/>" + json[i].optionE + "</label> </div></li>";
               
               // s += "<li><div class='big'>" + json[i].CustomTitle + "</div></li><li><div class='big'>" + json[i].CustomContent + " </div></li><li><img class='img[]' src='" + json[i].images + "' /></li>";
              //  s += "<li><div class='01' style='font-size:80px; color:#576ffe;'><strong>" + json[i].CustomTitle + "</strong></div></li><br/><br/><li><div class='02' style='color:576ffe;'>" + json[i].CustomContent + " </div></li><br/><br/><li><div class='03'><img class='img[]' src='images/head.jpg' /></div></li>";
                s += "<li><div class='01' style='font-size:80px; color:#576ffe;'><strong>" + json[i].CustomTitle + "</strong></div></li><br/><br/><li><div class='02' style='color:576ffe;'>" + json[i].CustomContent + " </div></li><br/><br/><li><div class='03'><img class='img[]' src='" + json[i].images + "' /></div><br/><br/></li>";
            }
            return s;
        }

    </script>
    <style>
        input[type="radio"] {
            position: absolute;
            left: -999em;
        }

            input[type="radio"] + label:before {
                background-position: -20px -21px;
            }

            input[type="radio"]:checked + label:before {
                background-position: -20px 2px;
            }

        /*.text1{
            width: 100%;
            height: 100%;
            position: fixed;
            z-index: -10;
            background-image: url(img/beijing.png);
            background-repeat: no-repeat;
            background-position: 0px 0px;
            background-size: 100% 100%;
            }*/

        /*背景颜色设计*/
        .div {
            width: 100%;
            height: 1805px;
            z-index: -10;
            /*background-image: url(img/beijing.png);*/
            background-repeat: no-repeat;
            background-position: 0px 0px;
            background-size: 100% 100%;
        }

        .text1 {
            width: 90%;
            margin: 0 auto;
        }

        .h2 {
            width: 90%;
            margin: 0 auto;
            text-align: center;
            color: #576ffe;
            font-size: 80px;
            font-weight: bold;
        }

        #menu li div {
            font-size:50px;
            color:#576ffe;
        }
        #menu li div img {
        width: 100%;
        margin: 0 auto;
        height: 700px;
        border: #576ffe 1px solid;
        color: #576ffe;
        font-size: 14px;
     }
        .suggest_nr img {
        width: 100%;
        margin: 0 auto;
        height: 400px;
        border: #576ffe 1px solid;
        color: #576ffe;
        font-size: 14px;
    }

        .big {
            width: 100%;
            display: block;
            height: 44px;
            line-height: 44px;
            margin-bottom: 0%;
        }

        .w1 {
            width: 100%;
            height: 20px
        }

            .w1 img {
                width: 100%;
            }

    
        #c1 {
            background: #f8fbf9;
            /*color: #8b5c2b;*/
            color: #576ffe;
            width: 18%;
            text-align: center;
            font-size: 14px;
            border: #eaeaea 1px solid;
            height: 30px;
            line-height: 30px;
            display: block;
            float: left;
            margin-right: 1.4%;
            border-radius: 2px;
            box-shadow: 1px 1px #eaeaea
        }

        .text1 ul li span {
            display: block;
            color: #576ffe;
            /*color: #8b5c2b;*/
            margin-bottom: 5%;
            font-size: 16px;
            font-weight:bold;
        }

        @media screen and (max-width: 320px) { /*iphone5s */
            #c1 {
                width: 18%;
                height:auto;
                margin-right: 1.3%;
            }
        }

        @media screen and (max-width: 320px) and (max-height: 480px) { /*iphone4s */
            #c1 {
                width: 18%;
                height:auto;
                margin-right: 1.3%;
            }
        }
    </style>

</head>
<body class="body">
    <div class="div">
        <div class="bgg1"></div>
        <div class="lauguage1"></div>
        <%--    <h2 style="align-content:center;">
        <img src="img/slogan1.png" />
        问卷调查
    </h2><hr/>--%>
        <div class="text1">
<%--            <br />
            <br />
            <h1 class="h2"><%=Custom_Information %></h1>
            <br />--%>
            <br /><br /><br />
            <ul id="menu">
            </ul>
        </div>
<%--            <div class="please">
        如您对我们有什么建议，非常欢迎您向我们提出，我们会非常珍视每一位顾客的意见。
    </div>--%>
<%--    <div class="suggest_nr">
        <textarea id="textarea01" name="" placeholder=" 请输入… " readonly="readonly"></textarea>
    </div>--%>
<%--    <div class="suggest_nr" id="div03">

    </div>--%>

    </div>
</body>
</html>
